package com.seedwill.common.meta.base;

import java.io.Serializable;

import com.seedwill.common.meta.IData;
import com.seedwill.common.meta.IIdentity;

public class AIdentity extends AData implements IIdentity {

	protected String identityName;
	protected IData identityVal;
	protected Serializable serializableIdentity;
	
	@Override
	public boolean according(IIdentity another) {
		if(this.getMeta().equals(another.getMeta()) 
				&& this.getIdentityVal().equals(another.getIdentityVal())){
			return true;
		}
		return false;
	}

	public AIdentity(String identityName, IData identityVal) {
		super();
		this.identityName = identityName;
		this.identityVal = identityVal;
	}

	public AIdentity(String identityName, Serializable serializableIdentity) {
		super();
		this.identityName = identityName;
		this.serializableIdentity = serializableIdentity;
	}

	public AIdentity(String identityName, IData identityVal,
			Serializable serializableIdentity) {
		super();
		this.identityName = identityName;
		this.identityVal = identityVal;
		this.serializableIdentity = serializableIdentity;
	}

	@Override
	public String getIdentityName() {
		return identityName;
	}

	@Override
	public IData getIdentityVal() {
		// TODO Auto-generated method stub
		return identityVal;
	}

	@Override
	public Serializable getSerializableIdentity() {
		// TODO Auto-generated method stub
		return serializableIdentity;
	}

}
